import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Enumeration;

/**
 * Created by donar on 17/11/30.
 */
public class IdWorkers {
    public static void main(String[] args) throws UnknownHostException, SocketException {
        InetAddress localAddress = InetAddress.getLocalHost();
        System.out.println(localAddress);
        Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
        while (interfaces.hasMoreElements()){
            NetworkInterface networkInterface = interfaces.nextElement();
            Enumeration<InetAddress> addressEnumeration = networkInterface.getInetAddresses();
            System.out.println(networkInterface.getName()+" == "+networkInterface.getDisplayName());
            while(addressEnumeration.hasMoreElements()){
                System.out.println(addressEnumeration.nextElement());
            }
        }

    }


    public void nextId(){}


}
